package bakery.dao;

import java.sql.SQLException;
import java.util.ArrayList;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import bakery.vo.AddressVO;
import bakery.vo.MainCategoryVO;
import bakery.vo.MemberVO;


public class MemberDAO {

	private SqlMapClientTemplate client;
	
	public MemberDAO(SqlMapClientTemplate client){
		this.client = client;
	}
	
	public void insertMember(MemberVO mvo) throws SQLException{
		client.insert("insertMember", mvo);
	}
	
	public void deleteMember(String id) throws SQLException{
		client.delete("deleteMember", id);
	}
	
	public void updateMember(MemberVO mvo) throws SQLException{
		client.update("updateMember", mvo);
	}
	
	public MemberVO selectMember(String id) throws SQLException{
		return (MemberVO)client.queryForObject("selectMember", id);
	}

	public ArrayList<AddressVO> selectAddress(String dong) throws SQLException{
		return (ArrayList<AddressVO>)client.queryForList("selectAddress", dong);
	}

}
